package com.ks.core.core;

import com.ks.core.constant.Const;
import lombok.AllArgsConstructor;

/**
 * 响应码枚举，参考HTTP状态码的语义
 */
@AllArgsConstructor
public enum ResultCode {
    SUCCESS(200, "请求成功", Const.VERSION),
    FAIL(400, "请求失败",Const.VERSION),
    UNAUTHORIZED(401, "接口未认证",Const.VERSION),
    NOT_FOUND(404, "404",Const.VERSION),
    INTERNAL_SERVER_ERROR(500, "系统异常",Const.VERSION);

    private final int code;
    private final String message;
    private final String version;

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getVersion(){
        return version;
    }

}
